package cn.bigfire.wzdj.util;

import cn.hutool.core.util.StrUtil;
import cn.bigfire.wzdj.pojo.bo.WZDJPack;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
@Slf4j
public class ResHexAnalyze {

    public static List<String> revPackBase64List = new ArrayList<>();

    static {
        //发送登录数据包
        revPackBase64List.add("AQBAAAEACgAkAAAACiJmanhFbTB4Y0xySTY0dW8zRHk5TjlWRUcwQnhsWmttaDVW");
        revPackBase64List.add("AQAQAP8/J2c=");
        revPackBase64List.add("AQBAAAEAEgBKAQAACscCCA0qGAoHanIxMDAwNRILCgdjb3VudGVyEAQYASoLCgdqcjExMDA2GAEqCwoHanIxMDAwNhgBKgsKB2pyMTEwMDcYASoYCgdqcjEwMDAzEgsKB2NvdW50ZXIQARgBKgsKB2pyMTEwMDQYASoLCgdqcjEwMDA0GAEqCwoHanIxMTAwNRgBKgsKB2pyMTAwMDEYASoYCgdqcjExMDAyEgsKB2NvdW50ZXIQAhgBKhgKB2pyMTAwMDISCwoHY291bnRlchADGAEqGAoHanIxMTAwMxILCgdjb3VudGVyEAEYASoYCgdqcjEwMDEwEgsKB2NvdW50ZXIQAhgBKgsKB2pyMTEwMDEYASoLCgdqcjEwMDA5GAEqGAoHanIxMDAwNxILCgdjb3VudGVyEAoYASoLCgdqcjExMDA4GAEqCwoHanIxMDAwOBgB");
        revPackBase64List.add("AQBAACkACgAuAAAACgYKBHNrXzESCAgBEgRza18xEggIAhIEc2tfMRoICgZza18xMDEaBgoEc2tfMQ==");
        revPackBase64List.add("AQBAAB0ACgAJAAAACgcKBXVoZl8x");
        revPackBase64List.add("AQBAAAkACgBCAAAACkAKKwjRxvoFEg7ov5DmsJTnjosjMzY0ORoIdWhpXzEwMDEiBXVoZl8xKAIw6gMSBRAeGMEIIP//nLkGKJHo97cG");
        revPackBase64List.add("AQBAACIACgASAAAACgQIARABCgQIAhABCgQIAxAB");
        revPackBase64List.add("AQBAAAIAEQAWBAAACk4I4V0QwawCGhUIASDk3Jy5Bij///////////8BMAEaFQgCIOTcnLkGKP///////////wEwARoVCAMg5NycuQYo////////////ATABMAEKQgiBfRD///////////8BGhcIARgDIJHo97cGKP///////////wEwARoXCAIYDyCR6Pe3Bij///////////8BMAEwAQqMAQjBuwEQwd2QARoXCAMYBSDk3Jy5Bij///////////8BMAEaGAjpBxgFIOTcnLkGKP///////////wEwARoYCOoHGAUg5NycuQYo////////////ATABGhgI6wcYBSDk3Jy5Bij///////////8BMAEaGAjsBxgFIOTcnLkGKP///////////wEwATABCj8I6YQBEP///////////wEaFQgBIJHo97cGKP///////////wEwARoVCAIgkej3twYo////////////ATABMAEKPAipwwEQwawCGhcIEBgFILSMjrkGKP///////////wEwARoXCA8YBSC0jI65Bij///////////8BMAEwAQoiCJBOEMGsAhoXCAEYAyDk3Jy5Bij///////////8BMAEwAQqUAQiRThDBrAIaGQjXnAEYASDk3Jy5Bij///////////8BMAEaGQjYnAEYASDk3Jy5Bij///////////8BMAEaGQionAEYASDk3Jy5Bij///////////8BMAEaGQirnAEYASDk3Jy5Bij///////////8BMAEaGQi8nAEYASDk3Jy5Bij///////////8BMAEgAygDMAEKKQixbRD///////////8BGhcIARhkIJHo97cGKP///////////wEwATABCiIIkcsBEMFLGhcICRgDIOTcnLkGKP///////////wEwATABCp4BCPKrARDAlRIaFwgBGAEgtIyOuQYo////////////ATABGhcIAhgBILSMjrkGKP///////////wEwARoXCAMYASC0jI65Bij///////////8BMAEaFwgEGAEgtIyOuQYo////////////ATABGhcIBRgBILSMjrkGKP///////////wEwARoVCAYgtIyOuQYo////////////ATABMAEKmgEI+VUQ////////////ARoVCAEgkej3twYo////////////ATABGhUIAiCR6Pe3Bij///////////8BMAEaFQgDIJHo97cGKP///////////wEwARoVCAQgkej3twYo////////////ATABGhUIBSCR6Pe3Bij///////////8BMAEaFQgGIJHo97cGKP///////////wEwATABCioImXUQ////////////ARoYCJFOGAEgkej3twYo////////////ATABMAE=");
        revPackBase64List.add("AQBAAAkAEQAIAAAACgYBAgMEBQY=");
        revPackBase64List.add("AQBAABIAIABcAAAACAEQwJUSGlQSBAgBEAASBAgCEAASBAgDEAASBAgEEAASBAgFEAAaBAgBEAAaBAgCEAAaBAgDEAAaBAgEEAAaBAgFEAAiBAgDEAAiBAgFEAAiBAgIEAAiBAgMEAA=");
        revPackBase64List.add("AQBAAAEAEgBKAQAACscCCA0qGAoHanIxMDAwNRILCgdjb3VudGVyEAQYASoLCgdqcjExMDA2GAEqCwoHanIxMDAwNhgBKgsKB2pyMTEwMDcYASoYCgdqcjEwMDAzEgsKB2NvdW50ZXIQARgBKgsKB2pyMTEwMDQYASoLCgdqcjEwMDA0GAEqCwoHanIxMTAwNRgBKgsKB2pyMTAwMDEYASoYCgdqcjExMDAyEgsKB2NvdW50ZXIQAhgBKhgKB2pyMTAwMDISCwoHY291bnRlchADGAEqGAoHanIxMTAwMxILCgdjb3VudGVyEAEYASoYCgdqcjEwMDEwEgsKB2NvdW50ZXIQAhgBKgsKB2pyMTEwMDEYASoLCgdqcjEwMDA5GAEqGAoHanIxMDAwNxILCgdjb3VudGVyEAoYASoLCgdqcjExMDA4GAEqCwoHanIxMDAwOBgB");
        revPackBase64List.add("AQBAAAkAIAAGAAAACAIQwJUS");
        revPackBase64List.add("AQBAAAEAEgBKAQAACscCCA0qGAoHanIxMDAwNRILCgdjb3VudGVyEAQYASoLCgdqcjExMDA2GAEqCwoHanIxMDAwNhgBKgsKB2pyMTEwMDcYASoYCgdqcjEwMDAzEgsKB2NvdW50ZXIQARgBKgsKB2pyMTEwMDQYASoLCgdqcjEwMDA0GAEqCwoHanIxMTAwNRgBKgsKB2pyMTAwMDEYASoYCgdqcjExMDAyEgsKB2NvdW50ZXIQAhgBKhgKB2pyMTAwMDISCwoHY291bnRlchADGAEqGAoHanIxMTAwMxILCgdjb3VudGVyEAEYASoYCgdqcjEwMDEwEgsKB2NvdW50ZXIQAhgBKgsKB2pyMTEwMDEYASoLCgdqcjEwMDA5GAEqGAoHanIxMDAwNxILCgdjb3VudGVyEAoYASoLCgdqcjExMDA4GAEqCwoHanIxMDAwOBgB");
        revPackBase64List.add("AQBAAAsAIAASAAAACAIQwJUSGgQIARABGgQIARAC");

        //匹配后下发的数据包
        revPackBase64List.add("AQBAAAoAFgClAAAACjoKJDZiZDNmMmM0LWY5NjEtNDU4NC1hZWUzLWQyZmI5ZjQ2MGVlZRIOd3pkai5obnlzNjguY24Y4Z4BEjAKKAjJub0GEgvku6Plj7cjOTcwNRoIdWhpXzEwMDEiBXVoZl8xKAQwmgMSBHNrXzESMworCNHG+gUSDui/kOawlOeOiyMzNjQ5Ggh1aGlfMTAwMSIFdWhmXzEoAjDqAxIEc2tfMRgB");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
        revPackBase64List.add("");
    }

    public static void main(String[] args) {
        for (int i = 0; i < revPackBase64List.size(); i++) {
            String base64 = revPackBase64List.get(i);
            if (StrUtil.isBlank(base64)) {
                continue;
            }
            byte[] bytes = Base64.getDecoder().decode(base64);
            List<WZDJPack<?>> packList = PackUtil.decodeBytes(bytes);
            for (WZDJPack<?> wzdjPack : packList) {
                log.info(wzdjPack.toString());
            }
//            WZDJPack wzdjPack = WZDJPack.parse(bytes);
//            log.info("//" + wzdjPack.toString());
        }
    }



}
